import { createRouter, createWebHistory } from 'vue-router'

//导入组件
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

import EmailList from "../views/email/EmailList.vue"
import DataList from '../views/email/DataList.vue'
import ResultList from '../views/email/ResultList.vue'
import OnlineInspection from '../views/email/OnlineInspection.vue'


//定义路由关系
const routes = [
    {
        path: '/', component: LayoutVue, redirect: '/email/emailList', children: [
            { path: '/email/emailList', component: EmailList },
            { path: '/email/dataList', component: DataList },
            { path: '/email/resultList', component: ResultList },
            { path: '/email/onlineInspection', component: OnlineInspection }
        ]
    }
]

//创建路由器
const router = createRouter({
    history: createWebHistory(),
    routes: routes
})

//导出路由
export default router
